import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    isLogin: localStorage.getItem('isLogin') === 'true' || false,
    cartNum:0
  },
  mutations: {
    changeLoginState(state, payload){
      state.isLogin = payload
    },
    changeCartNum(state,num){
      state.cartNum += num
    }
  },
  actions: {
  },
  modules: {
  }
})
